Merged
Conversation
Introduce ActivitySearchFiltersDto to model activity search filters, add an ActivityService interface with an activitySearch method, and extend SearchEndpoint with a new GET /activities handler wired to accept the filters via @ModelAttribute/@ParameterObject. The endpoint currently returns an empty placeholder; the service signature uses existing OpeningSearch DTOs and should be implemented to perform the actual search.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “activity search” API and supporting service/repository layer so searches can run against either PostgreSQL or Oracle, with shared contract tests for both DB modes.
Changes:
- Introduces
/api/search/activitiesendpoint with filter DTOs and response DTO mapping. - Adds DB-specific repositories/services and native queries (Postgres + Oracle) for activity search.
- Adds unit + integration test contracts and DB-specific integration test runners.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/src/main/java/ca/bc/gov/restapi/results/common/endpoint/SearchEndpoint.java | Adds the new activity search HTTP endpoint and wires it to ActivityService. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/service/ActivityService.java | Introduces the service interface for activity search. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/service/impl/AbstractActivityService.java | Implements shared activity search logic (query, client enrichment, DTO mapping). |
| backend/src/main/java/ca/bc/gov/restapi/results/postgres/service/ActivityPostgresService.java | Provides Postgres-specific ActivityService bean via conditional configuration. |
| backend/src/main/java/ca/bc/gov/restapi/results/oracle/service/ActivityOracleService.java | Provides Oracle-specific ActivityService bean via conditional configuration. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/repository/ActivityTreatmentUnitRepository.java | Adds the cross-DB repository contract method activitySearch(...). |
| backend/src/main/java/ca/bc/gov/restapi/results/postgres/repository/ActivityTreatmentUnitPostgresRepository.java | Implements native activity search query for Postgres repository. |
| backend/src/main/java/ca/bc/gov/restapi/results/oracle/repository/ActivityTreatmentUnitOracleRepository.java | Implements native activity search query for Oracle repository. |
| backend/src/main/java/ca/bc/gov/restapi/results/postgres/SilvaPostgresQueryConstants.java | Adds the Postgres native SQL for activity search. |
| backend/src/main/java/ca/bc/gov/restapi/results/oracle/SilvaOracleQueryConstants.java | Adds the Oracle native SQL for activity search. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/projection/ActivitySearchProjection.java | Defines projection used by native activity search queries. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/dto/activity/ActivitySearchFiltersDto.java | Adds filters DTO with NOVALUE defaulting and “hasAnyFilter” logic. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/dto/activity/ActivitySearchResponseDto.java | Adds response DTO for activity search results. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/util/DateUtil.java | Centralizes date range validation used by search services. |
| backend/src/main/java/ca/bc/gov/restapi/results/common/service/impl/AbstractOpeningSearchService.java | Switches opening search date-range validation to DateUtil. |
| backend/src/test/java/ca/bc/gov/restapi/results/common/service/impl/AbstractActivityServiceTest.java | Adds unit tests for shared activity search mapping/enrichment logic. |
| backend/src/test/java/ca/bc/gov/restapi/results/common/service/AbstractActivityServiceIntegrationTest.java | Adds DB-agnostic integration contract tests for activity search service. |
| backend/src/test/java/ca/bc/gov/restapi/results/common/endpoint/AbstractSearchEndpointActivitySearchIntegrationTest.java | Adds DB-agnostic integration contract tests for activity search endpoint. |
| backend/src/test/java/ca/bc/gov/restapi/results/common/util/DateUtilTest.java | Adds unit tests for date-range validation helper. |
| backend/src/test/java/ca/bc/gov/restapi/results/postgres/service/ActivityServicePostgresIntegrationTest.java | Runs the abstract activity-service contract tests against Postgres. |
| backend/src/test/java/ca/bc/gov/restapi/results/oracle/service/ActivityServiceOracleIntegrationTest.java | Runs the abstract activity-service contract tests against Oracle. |
| backend/src/test/java/ca/bc/gov/restapi/results/postgres/endpoint/SearchEndpointActivitySearchPostgresIntegrationTest.java | Runs the abstract endpoint contract tests against Postgres. |
| backend/src/test/java/ca/bc/gov/restapi/results/oracle/endpoint/SearchEndpointActivitySearchOracleIntegrationTest.java | Runs the abstract endpoint contract tests against Oracle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/src/main/java/ca/bc/gov/restapi/results/common/util/DateUtil.java
Show resolved
Hide resolved
...nd/src/main/java/ca/bc/gov/restapi/results/common/dto/activity/ActivitySearchFiltersDto.java
Outdated
Show resolved
Hide resolved
...a/ca/bc/gov/restapi/results/postgres/repository/ActivityTreatmentUnitPostgresRepository.java
Outdated
Show resolved
Hide resolved
.../java/ca/bc/gov/restapi/results/oracle/repository/ActivityTreatmentUnitOracleRepository.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/ca/bc/gov/restapi/results/postgres/SilvaPostgresQueryConstants.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/ca/bc/gov/restapi/results/oracle/SilvaOracleQueryConstants.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/ca/bc/gov/restapi/results/common/endpoint/SearchEndpoint.java
Show resolved
Hide resolved
…om/bcgov/nr-silva into feat/1165-activity-search-endpoint
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/src/main/java/ca/bc/gov/restapi/results/postgres/SilvaPostgresQueryConstants.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/ca/bc/gov/restapi/results/oracle/SilvaOracleQueryConstants.java
Outdated
Show resolved
Hide resolved
...gov/restapi/results/common/endpoint/AbstractSearchEndpointActivitySearchIntegrationTest.java
Show resolved
Hide resolved
backend/src/test/java/ca/bc/gov/restapi/results/common/util/DateUtilTest.java
Show resolved
Hide resolved
…om/bcgov/nr-silva into feat/1165-activity-search-endpoint
Abradat
reviewed
Feb 17, 2026
...end/src/main/java/ca/bc/gov/restapi/results/common/service/impl/AbstractActivityService.java
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an activity search endpoint with the ability to search over postgres and oracle DBs.
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in: